<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="robots" content="nofollow">
    <title>后台管理系统</title>
    <link href="__STATIC__/old/back-end/css/layout.css" rel="stylesheet" type="text/css" />
    <script src="__STATIC__/old/back-end/js/jquery.min.js"></script>
    <script src="__STATIC__/old/back-end/js/jquery.form.js"></script>
    <script src="__STATIC__/old/back-end/js/plugins/layer/layer.min.js"></script>
</head>

<body>
<div id="wrapper">
    <div class="top">
    </div>
    <div class="login w1100">
        <div class="logo">
            <!--<img src="__STATIC__/old/back-end/img/logo.png" width="523" height="67"/>-->后台管理系统
        </div><!--logo-->
        <div class="register">
            <div class="reg-l">
                <form method="post" id="form">
                    <ul class="reg-login">
                        <li>
                            <label class="label-input">帐号</label>
                            <input name="user" type="text"  class="reg-name">
                        </li>
                        <li>
                            <label class="label-input">密码</label>
                            <input name="pwd" type="password"  class="reg-name">
                        </li>
                        <li>
                            <label class="label-input">验证码</label>
                            <input name="code" type="text"  class="reg-code">
                            <img id="code_img" src="{:url('index/verify');}" width="120" height="40">
                        </li>
                    </ul>
                    <div class="reg-bt">
                        <div class="login-bt">
                            <a href="javascript:void(0)" class="btn" onclick="$('#form').submit()" >登录</a>
                        </div>
                        <div class="password">
                        </div>
                    </div>
                </form>
            </div><!--reg-l-->
            <div class="reg-r">
                <img src="__STATIC__/old/back-end/img/img.png">
            </div><!--reg-r-->
        </div><!--register-->
    </div><!--login-->
    <div class="foot"></div>
</div>


<script>
    layer.config({
        extend: ["extend/layer.ext.js", "skin/moon/style.css"],
        skin: "layer-ext-moon"
    });

    $("#code_img").click(function () {
        $("#code_img").attr('src', "{:url('index/verify');}")
    });

    $('#form').submit(function(){
        $('#form').ajaxSubmit({
            url: "{:url('index/checkLogin')}",
            dataType: "json",
            success: function(res) {
                if (res.status == 1)
                {
                    layer.msg('登陆成功',{time:500},function () {
                        location.href = '/admin/index/home'; //后台主页
                    })
                } else
                {
                    layer.msg(res.msg);
                    $("#code_img").attr('src', "{:url('index/verify');}")
                }
            }
        });
        return false;
    });
    window.onkeydown=function (){
        if(event.keyCode==13)
        {
            $(".btn").click();
        }
    }
</script>
</body>
</html>

